An oscillator (e.g., a ring oscillator) is often used in electronic circuits to generate precise clock signals. The oscillation frequency varies with ambient temperature, which can affect the operation of the electronic circuit. It is therefore desirable to reduce the influence of the change of ambient temperature on the oscillator frequency.